public class NO32{
	public ArrayList<Integer> printFromTopToBettom(TreeNode root){
		if(root == null ){
			return null;
			}
			
			ArrayList<Integer> list = new ArrayList<Integer>();
			LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
			
			queue.offer(root);
			list.add(root);
			
			while(!queue.isEmpty){
				int size = queue.size();
				for(in ti = 0;i<size;i++){
					TreeNode head = queue.poll();
					
					if(head.left != null ){
						queue.offer(head.left);
						list.add(head.left.val);
						}
					if(head.right != null ){
						queue.offer(head.right);
						list.add(head.right.val);
						}
					}
				}
				return list;
		}
	}